<div>
  <style type="text/css">
    .standard-item-style {
        padding-right: 20px;
        padding-bottom: 5px;
        float: left;
    }
    .line-middle {
        vertical-align: middle !important;
    }
    .red {
      color: #f00;
    }
  </style>

  <div class="container-fluid form-horizontal ">
    
      <div class="modal-body">
        <div class="container-fluid">

          <!-- <ul ui-jq="sortable" class="list-group gutter list-group-lg list-group-sp" > -->
          
          <!-- 上面自定义规格框 -->
          <div class="well b bg-light wrapper-md" ng-repeat="item in tabletitle">
            <button class="btn btn-rounded btn-sm btn-icon btn-danger pull-right" type="button" ng-click="deleteStandard($index)">
              <i class="fa fa-times"></i>
            </button>
            <div class="form-group">
              <div class="input-group m-b col-md-5">
                <input type="text" class="form-control" ng-model="item.sku_type">
                <span class="input-group-btn">
                  <button class="btn btn-info" type="button" ng-click="addStandardItem(item)">
                    <i class="glyphicon glyphicon-plus" /> 添加规格项
                  </button>
                </span>
              </div>
              <div class="col-md-12">
                <div class="col-md-3 standard-item-style"  ng-repeat="item2 in item.list">
                  <div class="input-group m-b">
                    <span class="input-group-addon">
                      <input type="checkbox" ng-model="item2.is_check" ng-true-value="'1'" ng-false-value="'0'">
                    </span>
                    <input type="text" class="form-control" ng-model="item2.sku_name">
                    <span class="input-group-btn">
                      <button class="btn btn-default" ng-click="removeItem($index, item)" type="button">
                        <i class="fa fa-times text-danger"></i>
                      </button>
                    </span>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <!-- </ul> -->

          <div class="form-group">
            <div class="col-md-2 col-md-offset-1" style="width: 10%">
              <button class="btn btn-primary" type="button" ng-click="addStandard()">
                <i class="glyphicon glyphicon-plus" /> 添加规格
              </button>
            </div>
            <div class="col-md-2">
              <button class="btn btn-primary" type="button" ng-click="refresh(true)">
                <i class="glyphicon glyphicon-refresh" /> 刷新项目规格表
              </button>
            </div>
          </div>
          <div class="form-group">
              <i class="col-md-8 col-md-offset-1 red">
                <span class="col-md-2 text-right">温馨提示：</span>
                <span>1.全部规格信息以刷新后的项目规格表为准；</span><br/>
                <span class="col-md-offset-2">2.如果库存为0，表示对应规格产品已售罄。并且价格不可为负数；</span>
              </i>
          </div>

          <!-- 下面，规格汇总表 -->
          <div class="bg-light" ng-show="tabledata.length > 0">
            <table class="table table-striped table-bordered dataTable">
                <thead>
                  <tr>
                    <th class="text-center" style="width: 7%" ng-repeat="item in formdata.showitem">{{item}}</th>
                    <th class="text-center" style="width: 7%">库存</th>
                    <th class="text-center" style="width: 7%">门市价</th>
                    <th class="text-center" style="width: 7%">指导价</th>
                    <th class="text-center" style="width: 7%">分销价</th>
                    <th class="text-center" style="width: 7%">采购价</th>
                  </tr>
                </thead>
                <tbody>
                  <tr ng-repeat="obj1 in tabledata">
                    <td class="text-center line-middle" ng-repeat="obj2 in formdata.showitem" rowspan="{{obj1['rowspan'+$index]}}"
                    ng-if="$parent.$index%obj1['rowspan'+$index]==0">{{obj1['name'+$index]}}</td>
                    <td class="text-center">
                      <input type="number" class="form-control" placeholder="0" min="-1" ng-model="obj1.stock_num">
                    </td>
                    <td class="text-center">
                      <input type="number" class="form-control" placeholder="0.00" min="0" ng-model="obj1.market_price">
                    </td>
                    <td class="text-center">
                      <input type="number" class="form-control" placeholder="0.00" min="0" ng-model="obj1.guide_price">
                    </td>
                    <td class="text-center">
                      <input type="number" class="form-control" placeholder="0.00" min="0" ng-model="obj1.cost_price">
                    </td>
                    <td class="text-center">
                      <input type="number" class="form-control" placeholder="0.00" min="0" ng-model="obj1.purchase_price">
                    </td>
                  </tr>
                </tbody>
              </table>
          </div>

        </div>
      </div>
      <div class="modal-footer">
          <div class="col-md-4 col-md-offset-2 text-center">
            <button type="button" class="btn btn-primary btn-lg btn-block" ng-click="save()">保存</button>
          </div>
      </div>
  
  </div>
</div>